package com.cn.service.server.mc.Impl;

import com.cn.bean.dto.MoxiaoDto;
import com.cn.bean.pojo.mc.K3FlXx;
import com.cn.bean.pojo.mc.McMx;
import com.cn.bean.pojo.mc.McMxList;
import com.cn.mapper.dao.db1.mc.MoXiaoDao;
import com.cn.service.server.mc.MoXiaoService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

@Service
public class MoXiaoServiceImpl implements MoXiaoService {
    @Autowired(required = false)
    private MoXiaoDao moXiaoDao;
    @Override
    public List<MoxiaoDto> selectAllMoXiao(@Param("limit") int limit, @Param("page") int page, @Param("djBh") String djBh,@Param("lx") String lx,@Param("djZt") String djZt) {
        return moXiaoDao.selectAllMoXiao(limit,page,djBh,lx,djZt);
    }

    @Override
    public int updateZt(@Param("djBh") String djBh,@Param("sqrGh") String sqrGh,@Param("sqrXm") String sqrXm,@Param("sqrBmx") String sqrsqrBmXm,@Param("sqSj") String sqSj,@Param("zt") int zt,@Param("gzmDcMxcs") int gzmDcMxcs) {
        Boolean n=moXiaoDao.updateStatus(djBh,sqrGh,sqrXm,sqrsqrBmXm,sqSj,zt,gzmDcMxcs);
        if (n){
            return 1;
        }
        return 0;
    }

    @Override
    public int insertYC(String djBh, String lb, String scMoxiaoDate, BigDecimal scCpzj, String bcMoxiaoDate, BigDecimal bcCpzj, String jgts, int agzmDcMxcs, String zdr, String zdbm, String zdsj, String djId, String djsj, BigDecimal csWj, BigDecimal gzmBfZj, BigDecimal gzmCcdXx, BigDecimal gzmCcdSx, String ghZq, String k3Mc) {
        Boolean z=moXiaoDao.addMoXiao(djBh, lb, jgts,scCpzj,scMoxiaoDate,bcCpzj,bcMoxiaoDate,agzmDcMxcs, zdr, zdbm, zdsj, djId, djsj, csWj, gzmBfZj, gzmCcdXx, gzmCcdSx, ghZq, k3Mc);
        if (z){
            return 1;
        }
        return 0;
    }


    @Override
    public int addBfxx(String djbh, String lb, String bfsj, BigDecimal sjbfzj, String bfsm) {
        Boolean x=moXiaoDao.addBfxx(djbh,lb,bfsj,sjbfzj,bfsm);
        if (x){
            return 1;
        }
        return 0;
    }

    @Override
    public int delMoXiao(String djBh,int isDel) {
        Boolean z=moXiaoDao.delMoXiao(djBh,isDel);
        if (z){
            return 1;
        }
        return 0;
    }

    @Override
    public List<K3FlXx> selectMoXiaoBydjbh(String djBh,int agzmDcMxcs) {
        return moXiaoDao.selectMoxiaoBydjBh(djBh,agzmDcMxcs);
    }

    @Override
    public int updateMoXiao(String djBh, BigDecimal zjMxzj, String zjMxsj,BigDecimal bcMxzj, String bcMxsj,String ghZq) {
        Boolean s=moXiaoDao.updateMoXiao(djBh,zjMxzj,zjMxsj,bcMxzj,bcMxsj,ghZq);
        if (s){
            return 1;
        }
        return 0;
    }

    @Override
    public int updateYcjl(String djBh, int agzmDcMxcs, String xgr, String xgbm, String xgsj,String djZt, String ycqkjl) {
        return moXiaoDao.updateYcjl(djBh,agzmDcMxcs,xgr,xgbm,xgsj,djZt,ycqkjl);
    }


    @Override
    public int updateLjcs(String djBh,String agzmDcMxcs,String bcMoxiaoDate,BigDecimal bcCpzj) {
        Boolean c=moXiaoDao.updateLjcs(djBh,agzmDcMxcs,bcMoxiaoDate,bcCpzj);
        if (c){
            return 1;
        }
        return 0;
    }

    @Override
    public List<K3FlXx> selectAll(int limit, int page, String djBh, String lx, int zt) {
        return moXiaoDao.selectAll(limit,page,djBh,lx,zt);
    }

    @Override
    public int updateZTB(String djBh, int zt) {
        Boolean v=moXiaoDao.updateZtB(djBh,zt);
        if (v){
            return 1;
        }
        return 0;
    }

    @Override
    public int insertMcMx(int id, String gx, String sb, String banZu, String bz, int zt, int shZt, String sqrGh, String sqrXm, String sqrBm, String sqSj) {
        return moXiaoDao.insertMcMx(id,gx,sb,banZu,bz,zt,shZt,sqrGh,sqrXm,sqrBm,sqSj);
    }

    @Override
    public int insertMcMxList(int idList, int parentId, String zh, String djBh, String k3WlBm, String k3Mc, int zt, String lx, int gzmDcMxcs, BigDecimal bcMxzj, String bcMxsj, BigDecimal csWj, BigDecimal gzmBfZj, BigDecimal gzmCcdXx, BigDecimal gzmCcdSx, String ghZq) {
        return moXiaoDao.insertMcMxList(idList,parentId,zh,djBh,k3WlBm,k3Mc,zt,lx,gzmDcMxcs,bcMxzj,bcMxsj,csWj,gzmBfZj,gzmCcdXx,gzmCcdSx,ghZq);
    }

    @Override
    public Integer getMcMxAutoid() {
        return moXiaoDao.getMcMxAutoid();
    }

    @Override
    public Integer getMcMxListAutoid() {
        return moXiaoDao.getMcMxListAutoid();
    }



    @Override
    public List<McMx> getMcMx(int limit, int page, String id, String gx, int zt) {
        return moXiaoDao.getMcMx(limit,page,id,gx,zt);
    }

    @Override
    public List<McMxList> getMcMxList(Integer id) {
        return moXiaoDao.getMcMxList(id);
    }

    @Override
    public int upDateMcMx(McMx mx) {
        return moXiaoDao.upDateMcMx(mx);
    }

    @Override
    public int deleteMcMxListParentId(int parentId) {
        return moXiaoDao.deleteMcMxListParentId(parentId);
    }

    @Override
    public int upDateMcMxSh(int id, int zt, int shZt, String shrGh, String shrXm, String shrBm, String shSj) {
        return moXiaoDao.upDateMcMxSh(id,zt,shZt,shrGh,shrXm,shrBm,shSj);
    }

    @Override
    public int upDateGzmDcMxcs(String djBh, int gzmDcMxcs) {
        return moXiaoDao.upDateGzmDcMxcs(djBh,gzmDcMxcs);
    }

    @Override
    public Integer isCite(int gzmDcMxcs, String djBh) {
        return moXiaoDao.isCite(gzmDcMxcs,djBh);
    }


}
